package com.hnkywl.sts.action.flow.endState;

import com.hnkywl.sts.entity.sfgl.Sfk;
import com.hnkywl.sts.service.sfgl.TpfkService;
import com.hnkywl.sts.util.ApplicationInstance;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;

/**
 * Created with IntelliJ IDEA.
 * User: 灵韵
 * Date: 13-8-13
 * Time: 下午5:00
 * To change this template use File | Settings | File Templates.
 */
public class EndTPFkState implements EventListener {
    @Override
    public void notify(EventListenerExecution execution) throws Exception {
        // 改变状态  ytj--->ysp
        TpfkService tpfkService = ApplicationInstance.createTPFkshService();
        Sfk sfk = tpfkService.findTpfkDetailByProcessInstance(execution.getProcessInstance().getId());
        tpfkService.changeStatus(sfk.getId().toString(),"ysh");
    }
}
